Many computer graphics systems use pixels to define images. The pixels are arranged on a display screen as an rectangular array of points. Aliasing occurs because the pixels have a discrete nature. Artifacts can appear when an entire pixel is given a light intensity or color based upon an insufficient sample of points within that pixel. To reduce aliasing effects in images, the pixels can be sampled at subpixel locations within the pixel. Each of the subpixel sample locations contributes color data that can be used to generate the composite color of that pixel. However, some graphics systems may limit the amount of memory for storing subsample color data for each pixel. Thus, such graphic systems must carefully select which color data are stored so that these systems can still accurately produce a composite color for each pixel.
Uniform sampling is also known as supersampling, and is implemented in most high-end graphics devices. Supersampling requires large amounts of memory. For example, a conventional 1280×1024 framebuffer with 32-bit color and 32-bit depth uses 10 Megabytes (MB) of memory. But with 4×4 supersampling, more than 160 MB of memory are needed. Even worse, 4×4 supersampling would require about sixteen times the memory bandwidth of the convention framebuffer, or for a given memory bandwidth it would slow down rendering by a factor of around sixteen.
Careful examination of a supersampled pixel reveals that most of the color and depth values within a pixel differ little from each other. For example, if a pixel is completely covered by a surface, then most of the color and Z values are likely to be within a few percent of each other.
In software implementations of antialiasing, dynamic memory allocation can be used to vary the amount of storage used by each pixel. However, dynamic storage allocation is quite difficult and expensive to implement in hardware, and therefore a practical graphics processor must use the same amount of storage for every pixel. Since the amount of memory for each pixel is fixed, the representation of complex pixels (those with multiple surfaces of different colors) will be less accurate than in a system having more memory per pixel. The present invention uses Z gradient information to minimize errors in representing complex pixels using a small, fixed number of fragments.